package setDaemonDemo;

public class MyThread extends Thread{
    public MyThread(String name) {
        super(name);
    }

    @Override
    public void run() {
        for (int i = 0; i < 20; i++) {
            System.out.print(getName() + i + "次 ");

            //表示让出cpu在执行权
            Thread.yield();
            
        }
    }
}
